from diffusers import DiffusionPipeline
import torch
import torch_npu
from torch_npu.contrib import transfer_to_npu

torch.npu.set_compile_mode(jit_compile=False)

generator = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")
generator.to("cuda")
image = generator("An image of a squirrel in Picasso style").images[0]
image.save("image_of_squirrel_painting.png")